package cn.vconinfo.lims.delivery.service;

import cn.vconinfo.database.annotation.TargetDataSource;
import cn.vconinfo.lims.delivery.entity.XiCangInspectItem;
import cn.vconinfo.lims.delivery.entity.XiCangRequestQuery;
import cn.vconinfo.lims.delivery.mapper.XiCangInspectDeliveryMapper;
import cn.vconinfo.lims.delivery.model.XiCangInspectDelivery;
import cn.vconinfo.lims.delivery.model.XiCangRequestInfo;
import cn.vconinfo.lims.delivery.model.XiCangTestSubItem;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class XiCangInspectService {

    private final XiCangInspectDeliveryMapper xiCangInspectDeliveryMapper;


    /**
     *  查询开单项目
     *
     * @param itemCode
     * @return
     */
    @TargetDataSource("slave")
    public List<XiCangInspectDelivery> queryXiCangLisItems(String itemCode){
        return xiCangInspectDeliveryMapper.queryXiCangLisItems(itemCode);
    }

    /**
     *  查询检验项目
     *
     * @param inspectItem
     * @return
     */
    @TargetDataSource("slave")
    public List<XiCangTestSubItem> queryXiCangSubItems(XiCangInspectItem inspectItem){
        return xiCangInspectDeliveryMapper.queryXiCangSubItems(inspectItem);
    }

    /**
     *  查询患者的申请单信息
     *
     * @param query
     * @return
     */
    @TargetDataSource("slave")
    public List<XiCangRequestInfo> queryXiCangRequestInfo(XiCangRequestQuery query){
        return xiCangInspectDeliveryMapper.queryXiCangRequestInfo(query);
    }

}
